package javabase.desginpattern.behavior.handlerchain;

/**
 * 辅导员
 * @author fance
 * @date 18-4-26 下午2:54
 */
public class Instructor extends Leader {

    public Instructor(String name) {
        super(name);
    }

    @Override
    public void handleRequest(LeaveNode leaveNode) {
        if (leaveNode.getDays() <= 3) { // 小于3 天 可审批
            System.out.println("辅导员: " + name + "审批 " + leaveNode.getName()
            + "同学请假 " + leaveNode.getDays() + " 天");
        } else {
            if (this.successor != null) {
                this.successor.handleRequest(leaveNode);
            }
        }
    }
}
